"use strict";
cc._RF.push(module, 'c1a2dtUmIFAdqcs/dOyBMuy', 'alertMar');
// script/utlis/alertMar.js

"use strict";

cc.Class({
  "extends": cc.Component,
  properties: {
    message: {
      "default": null,
      type: cc.Label
    }
  },
  // onLoad () {},
  clear: function clear() {
    this.setMessage('');
    this.setOkCallBack(null);
    this.setCancelCallBack(null);
    this.setCloseCallBack(null);
  },
  show: function show(mess, okCallBack, cancelCallBack, closeCallBack) {
    this.clear();
    this.node.active = true;
    this.setMessage(mess);
    this.setOkCallBack(okCallBack);
    this.setCancelCallBack(cancelCallBack);
    this.setCloseCallBack(closeCallBack);
  },
  hide: function hide() {
    this.node.active = false;
  },
  onClickClose: function onClickClose() {
    this.hide();

    if (this.closeCallBack != null) {
      this.closeCallBack;
    }

    cc.director.loadScene('start');
  },
  onClickOk: function onClickOk() {
    this.hide();

    if (this.okCallBack != null) {
      this.okCallBack;
    }

    cc.director.loadScene('game');
  },
  onClickCancel: function onClickCancel() {
    this.hide();

    if (this.cancelCallBack != null) {
      this.cancelCallBack;
    }

    cc.director.loadScene('start');
  },
  setMessage: function setMessage(string) {
    this.message.string = string;
  },
  setOkCallBack: function setOkCallBack(callBack) {
    this.okCallBack = callBack;
  },
  setCloseCallBack: function setCloseCallBack(callBack) {
    this.closeCallBack = callBack;
  },
  setCancelCallBack: function setCancelCallBack(callBack) {
    this.cancelCallBack = callBack;
  }
});

cc._RF.pop();